3.3.68 \(\int \frac {A+B \log (\frac {e (a+b x)^2}{(c+d x)^2})}{(f+g x)^2} \, dx\) [268]

Optimal. Leaf size=90 \[ \frac {(a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{(b f-a g) (f+g x)}+\frac {2 B (b c-a d) \log \left (\frac {f+g x}{c+d x}\right )}{(b f-a g) (d f-c g)} \]

[Out]

(b*x+a)*(A+B*ln(e*(b*x+a)^2/(d*x+c)^2))/(-a*g+b*f)/(g*x+f)+2*B*(-a*d+b*c)*ln((g*x+f)/(d*x+c))/(-a*g+b*f)/(-c*g
+d*f)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {2554, 2351, 31} \begin {gather*} \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{(f+g x) (b f-a g)}+\frac {2 B (b c-a d) \log \left (\frac {f+g x}{c+d x}\right )}{(b f-a g) (d f-c g)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])/(f + g*x)^2,x]

[Out]

((a + b*x)*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2]))/((b*f - a*g)*(f + g*x)) + (2*B*(b*c - a*d)*Log[(f + g*x)/
(c + d*x)])/((b*f - a*g)*(d*f - c*g))

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2351

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x_Symbol] :> Simp[x*(d + e*x^r)^(q +
 1)*((a + b*Log[c*x^n])/d), x] - Dist[b*(n/d), Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q,
r}, x] && EqQ[r*(q + 1) + 1, 0]

Rule 2554

Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_)
)^(m_.), x_Symbol] :> Dist[b*c - a*d, Subst[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^
(m + 2)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && EqQ[n + mn, 0] && IGt
Q[n, 0] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^2} \, dx &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{g (f+g x)}+\frac {B \int \frac {2 (b c-a d)}{(a+b x) (c+d x) (f+g x)} \, dx}{g}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{g (f+g x)}+\frac {(2 B (b c-a d)) \int \frac {1}{(a+b x) (c+d x) (f+g x)} \, dx}{g}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{g (f+g x)}+\frac {(2 B (b c-a d)) \int \left (\frac {b^2}{(b c-a d) (b f-a g) (a+b x)}+\frac {d^2}{(b c-a d) (-d f+c g) (c+d x)}+\frac {g^2}{(b f-a g) (d f-c g) (f+g x)}\right ) \, dx}{g}\\ &=\frac {2 b B \log (a+b x)}{g (b f-a g)}-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{g (f+g x)}-\frac {2 B d \log (c+d x)}{g (d f-c g)}+\frac {2 B (b c-a d) \log (f+g x)}{(b f-a g) (d f-c g)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 108, normalized size = 1.20 \begin {gather*} \frac {-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{f+g x}+\frac {2 B (b (d f-c g) \log (a+b x)+(-b d f+a d g) \log (c+d x)+(b c-a d) g \log (f+g x))}{(b f-a g) (d f-c g)}}{g} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])/(f + g*x)^2,x]

[Out]

(-((A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])/(f + g*x)) + (2*B*(b*(d*f - c*g)*Log[a + b*x] + (-(b*d*f) + a*d*g)
*Log[c + d*x] + (b*c - a*d)*g*Log[f + g*x]))/((b*f - a*g)*(d*f - c*g)))/g

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(298\) vs. \(2(90)=180\).
time = 0.42, size = 299, normalized size = 3.32

method result size
risch \(-\frac {B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{g \left (g x +f \right )}-\frac {2 B \ln \left (g x +f \right ) a d \,g^{2} x -2 B \ln \left (g x +f \right ) b c \,g^{2} x +2 B \ln \left (-b x -a \right ) b c \,g^{2} x -2 B \ln \left (-b x -a \right ) b d f g x -2 B \ln \left (-d x -c \right ) a d \,g^{2} x +2 B \ln \left (-d x -c \right ) b d f g x +2 B \ln \left (g x +f \right ) a d f g -2 B \ln \left (g x +f \right ) b c f g +2 B \ln \left (-b x -a \right ) b c f g -2 B \ln \left (-b x -a \right ) b d \,f^{2}-2 B \ln \left (-d x -c \right ) a d f g +2 B \ln \left (-d x -c \right ) b d \,f^{2}+A a c \,g^{2}-A a d f g -A b c f g +A b d \,f^{2}}{\left (c g -d f \right ) \left (a g -b f \right ) \left (g x +f \right ) g}\) \(285\)
derivativedivides \(-\frac {-\frac {d^{2} A}{\left (\frac {c g -d f}{d x +c}-g \right ) \left (c g -d f \right )}+\frac {-\frac {b B d \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{a g -b f}-\frac {B d \left (a d -c b \right ) \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{\left (a g -b f \right ) \left (d x +c \right )}}{\frac {c g}{d x +c}-\frac {f d}{d x +c}-g}+\frac {2 B \,d^{2} \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right ) a}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}-\frac {2 B d \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right ) b c}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}}{d}\) \(299\)
default \(-\frac {-\frac {d^{2} A}{\left (\frac {c g -d f}{d x +c}-g \right ) \left (c g -d f \right )}+\frac {-\frac {b B d \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{a g -b f}-\frac {B d \left (a d -c b \right ) \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{\left (a g -b f \right ) \left (d x +c \right )}}{\frac {c g}{d x +c}-\frac {f d}{d x +c}-g}+\frac {2 B \,d^{2} \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right ) a}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}-\frac {2 B d \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right ) b c}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}}{d}\) \(299\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*ln(e*(b*x+a)^2/(d*x+c)^2))/(g*x+f)^2,x,method=_RETURNVERBOSE)

[Out]

-1/d*(-d^2*A/((c*g-d*f)/(d*x+c)-g)/(c*g-d*f)+(-b*B*d/(a*g-b*f)*ln(e*(a/(d*x+c)*d-b*c/(d*x+c)+b)^2/d^2)-B*d*(a*
d-b*c)/(a*g-b*f)/(d*x+c)*ln(e*(a/(d*x+c)*d-b*c/(d*x+c)+b)^2/d^2))/(c*g/(d*x+c)-f/(d*x+c)*d-g)+2*B*d^2/(a*c*g^2
-a*d*f*g-b*c*f*g+b*d*f^2)*ln(c*g/(d*x+c)-f/(d*x+c)*d-g)*a-2*B*d/(a*c*g^2-a*d*f*g-b*c*f*g+b*d*f^2)*ln(c*g/(d*x+
c)-f/(d*x+c)*d-g)*b*c)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (91) = 182\).
time = 0.28, size = 195, normalized size = 2.17 \begin {gather*} B {\left (\frac {2 \, b \log \left (b x + a\right )}{b f g - a g^{2}} - \frac {2 \, d \log \left (d x + c\right )}{d f g - c g^{2}} + \frac {2 \, {\left (b c - a d\right )} \log \left (g x + f\right )}{b d f^{2} + a c g^{2} - {\left (b c + a d\right )} f g} - \frac {\log \left (\frac {b^{2} x^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b x e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{g^{2} x + f g}\right )} - \frac {A}{g^{2} x + f g} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*log(e*(b*x+a)^2/(d*x+c)^2))/(g*x+f)^2,x, algorithm="maxima")

[Out]

B*(2*b*log(b*x + a)/(b*f*g - a*g^2) - 2*d*log(d*x + c)/(d*f*g - c*g^2) + 2*(b*c - a*d)*log(g*x + f)/(b*d*f^2 +
 a*c*g^2 - (b*c + a*d)*f*g) - log(b^2*x^2*e/(d^2*x^2 + 2*c*d*x + c^2) + 2*a*b*x*e/(d^2*x^2 + 2*c*d*x + c^2) +
a^2*e/(d^2*x^2 + 2*c*d*x + c^2))/(g^2*x + f*g)) - A/(g^2*x + f*g)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (91) = 182\).
time = 3.19, size = 277, normalized size = 3.08 \begin {gather*} -\frac {A b d f^{2} + A a c g^{2} - {\left (A b c + A a d\right )} f g - 2 \, {\left (B b d f^{2} - B b c f g + {\left (B b d f g - B b c g^{2}\right )} x\right )} \log \left (b x + a\right ) + 2 \, {\left (B b d f^{2} - B a d f g + {\left (B b d f g - B a d g^{2}\right )} x\right )} \log \left (d x + c\right ) - 2 \, {\left ({\left (B b c - B a d\right )} g^{2} x + {\left (B b c - B a d\right )} f g\right )} \log \left (g x + f\right ) + {\left (B b d f^{2} + B a c g^{2} - {\left (B b c + B a d\right )} f g\right )} \log \left (\frac {{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{b d f^{3} g + a c f g^{3} - {\left (b c + a d\right )} f^{2} g^{2} + {\left (b d f^{2} g^{2} + a c g^{4} - {\left (b c + a d\right )} f g^{3}\right )} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*log(e*(b*x+a)^2/(d*x+c)^2))/(g*x+f)^2,x, algorithm="fricas")

[Out]

-(A*b*d*f^2 + A*a*c*g^2 - (A*b*c + A*a*d)*f*g - 2*(B*b*d*f^2 - B*b*c*f*g + (B*b*d*f*g - B*b*c*g^2)*x)*log(b*x
+ a) + 2*(B*b*d*f^2 - B*a*d*f*g + (B*b*d*f*g - B*a*d*g^2)*x)*log(d*x + c) - 2*((B*b*c - B*a*d)*g^2*x + (B*b*c
- B*a*d)*f*g)*log(g*x + f) + (B*b*d*f^2 + B*a*c*g^2 - (B*b*c + B*a*d)*f*g)*log((b^2*x^2 + 2*a*b*x + a^2)*e/(d^
2*x^2 + 2*c*d*x + c^2)))/(b*d*f^3*g + a*c*f*g^3 - (b*c + a*d)*f^2*g^2 + (b*d*f^2*g^2 + a*c*g^4 - (b*c + a*d)*f
*g^3)*x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*ln(e*(b*x+a)**2/(d*x+c)**2))/(g*x+f)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*log(e*(b*x+a)^2/(d*x+c)^2))/(g*x+f)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Undef/Unsigned Inf encountered in limitU
ndef/Unsigned Inf encountered in limitsageVARB*(-(sageVARg*sageVARx+sageVARf)^-1/sageVARg*ln((sageVARb*(-sageV
ARf+1/sageVARg/(sageV

________________________________________________________________________________________

Mupad [B]
time = 5.34, size = 191, normalized size = 2.12 \begin {gather*} \frac {2\,B\,d\,\ln \left (c+d\,x\right )}{c\,g^2-d\,f\,g}-\frac {B\,\ln \left (\frac {e\,a^2+2\,e\,a\,b\,x+e\,b^2\,x^2}{c^2+2\,c\,d\,x+d^2\,x^2}\right )}{x\,g^2+f\,g}-\frac {2\,B\,b\,\ln \left (a+b\,x\right )}{a\,g^2-b\,f\,g}-\frac {A}{x\,g^2+f\,g}-\frac {2\,B\,a\,d\,\ln \left (f+g\,x\right )}{a\,c\,g^2+b\,d\,f^2-a\,d\,f\,g-b\,c\,f\,g}+\frac {2\,B\,b\,c\,\ln \left (f+g\,x\right )}{a\,c\,g^2+b\,d\,f^2-a\,d\,f\,g-b\,c\,f\,g} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*log((e*(a + b*x)^2)/(c + d*x)^2))/(f + g*x)^2,x)

[Out]

(2*B*d*log(c + d*x))/(c*g^2 - d*f*g) - (B*log((a^2*e + b^2*e*x^2 + 2*a*b*e*x)/(c^2 + d^2*x^2 + 2*c*d*x)))/(f*g
 + g^2*x) - (2*B*b*log(a + b*x))/(a*g^2 - b*f*g) - A/(f*g + g^2*x) - (2*B*a*d*log(f + g*x))/(a*c*g^2 + b*d*f^2
 - a*d*f*g - b*c*f*g) + (2*B*b*c*log(f + g*x))/(a*c*g^2 + b*d*f^2 - a*d*f*g - b*c*f*g)

________________________________________________________________________________________